﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HistogramPackage {
    class Csv {
        public List<string[]> import(System.IO.FileInfo file) {
            System.IO.StreamReader r = new System.IO.StreamReader(file.FullName);
            List<string[]> dataStore = new List<string[]>();

            string line;
            string[] row;
            while ((line = r.ReadLine()) != null) {
                row = line.Split(',');
                List<string> cleanRow = new List<string>();
                for (int i = 0; i < row.Length; i++) {

                    if (!row[i].Equals("")) {
                        cleanRow.Add(row[i]);
                    }
                }
                dataStore.Add(cleanRow.ToArray());
            }

            r.Close();

            return dataStore;
        }
    }
}
